﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace QLTV.HeThongXuLy
{
   
        public class KiemtraForm
        {           
            ///Class Kiem tra form dang duoc active hay khong
           
            public static bool IsFocusForm(Type type, Form frmParent)
            {
                int i = 0;
                if (frmParent == null) return false;
                foreach (Form frm in frmParent.MdiChildren)
                {
                    if (frm.GetType() == type)
                    {
                        if (frm.MinimizeBox)
                        {
                            frm.Focus();
                            frm.WindowState = FormWindowState.Normal;
                        }
                        frm.Focus();
                        return true;
                    }
                    else
                    {
                        i++;
                    }

                }
                if (i != 0)
                    return false;
                return false;
            }
        }
    
}
